﻿using Emgu.CV.Structure;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 仪表识别2
{
    static class ImageParams
    {
        //图像基本参数
        public static int width = 0;
        public static int height = 0;

        //缩放比例
        public static float zoom = 1;
        //旋转角度
        public static float rotationAngle = 0;
        //二值化参数
        public static int binThreshold = 100;
        public static int binMaxValue = 255;

        //自适应二值化参数
        public static int adaptiveMaxValue = 100;
        public static int adaptiveBlockSize = 3;
        public static int adaptiveParam1 = 3;

        //中值滤波参数
        public static int medianBlockSize = 3;

        //高斯滤波参数
        public static int edianKernelSize = 3;

        //边缘检测参数
        public static int cannyThresh = 100;
        public static int cannyThreshLinking = 255;

        //Laplace变换参数
        public static int laplaceApertureSize = 5;

        public static CircleF[] circles;
        public static LineSegment2D[] lines;


        //起始/终止刻度坐标
        public static Point pointStart = new Point();
        public static Point pointEnd = new Point();

        public static Point pointerStart = new Point();
        public static Point pointerEnd = new Point();
        public static double[] templateGray;
        //量程
        public static int range = 0;
        //读数
        public static double data = 0;

        public static List<CircleF> circlesWithSomeFrame = new List<CircleF>();



        //cmt匹配模式
        public static CTM_MODEL ctmModel = CTM_MODEL.POINT;

        public enum CTM_MODEL
        {
            POINT, //点模式
            _8_NEIGHBOR //8-邻域模式(此模式匹配更加精准，但计算量稍大)
        }

        //仪表类型
        public static MeterType meterType = MeterType.CIRCLE;

        public enum MeterType
        {
            CIRCLE, NOT_CIRCLE
        }

        //圆过滤参数
        public static int circle_min_r = 50;
        public static int circle_max_r = 200;

        //膨胀腐蚀参数
        public static int erode = -1;
        public static int dilate = -1;


        //RSCD最小被计算的轮廓长度
        public static int rscd_min_contours_len = 50;
        //RSCD包含区域半径
        public static int rscd_area_radius = 15;
        //RSCD包含区域内点的个数(只有达到这个值时才被认为是可能圆)
        public static int rscd_max_point_in_area = 30;


    }
}
